package com.jimmy.medical.entity;

import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import javax.persistence.*;

/**
 * 会员类型
 *
 * @author jimmy
 * @since 0.1
 */
@Entity
@Table(name = "member_type")
public class MemberType extends AbstractEntity {
    /**
     * 会员类型名称
     */
    @Column(name = "name", length = 100)
    private String name;
    /**
     * 会员周期
     */
    @Column(name = "cycle")
    private int cycle;
    /**
     * 会员指标,即续费需要达到多少金额才能成为该类型的会员
     */
    @Column(name = "limits")
    private int limits;
    /**
     * 是否启用
     */
    @Column(name = "is_enabled", length = 10)
    private String isEnabled;
    /**
     * 说明
     */
    @Column(name = "description", length = 500)
    private String description;

    /**
     * APP 端是否显示
     */
    @Column(name = "is_app", length = 1)
    private String isApp;
    /**
     * 所属城市(逗号分隔，前后无逗号，如果要like查询，自己在前面和后面加上逗号“‘，’||‘”)
     */
    @Column(name = "city_list", length = 128)
    private String cityList;

    /**
     * 服务类型
     */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "service_type_id")
    @NotFound(action = NotFoundAction.IGNORE)
    private SysCode serviceType;
    /**
     * LOGO
     */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "logo")
    @NotFound(action = NotFoundAction.IGNORE)
    private UploadFile logo;

    /**
     * 作弊人次
     */
    @Column(name = "cheating_num")
    private Integer cheatingNum;


    /**
     * 服务内容
     */
    @Column(name = "service_content")
    private String serviceContent;


    /**
     * 改文件关联的业务ID，如订单号等
     */
    @Column(name = "related_key")
    private String relatedKey;

    @Column(name = "create_time", length = 20)
    private String createTime;
    @Column(name = "create_user", length = 50)
    private String createUser;
    @Column(name = "update_time")
    private String updateTime;
    @Column(name = "update_user", length = 20)
    private String updateUser;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getCycle() {
        return cycle;
    }

    public void setCycle(int cycle) {
        this.cycle = cycle;
    }

    public int getLimits() {
        return limits;
    }

    public void setLimits(int limits) {
        this.limits = limits;
    }

    public String getIsEnabled() {
        return isEnabled;
    }

    public void setIsEnabled(String isEnabled) {
        this.isEnabled = isEnabled;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getIsApp() {
        return isApp;
    }

    public void setIsApp(String isApp) {
        this.isApp = isApp;
    }

    public String getCityList() {
        return cityList;
    }

    public void setCityList(String cityList) {
        this.cityList = cityList;
    }

    public UploadFile getLogo() {
        return logo;
    }

    public void setLogo(UploadFile logo) {
        this.logo = logo;
    }

    public Integer getCheatingNum() {
        return cheatingNum;
    }

    public void setCheatingNum(Integer cheatingNum) {
        this.cheatingNum = cheatingNum;
    }

    public String getServiceContent() {
        return serviceContent;
    }

    public void setServiceContent(String serviceContent) {
        this.serviceContent = serviceContent;
    }

    public String getRelatedKey() {
        return relatedKey;
    }

    public void setRelatedKey(String relatedKey) {
        this.relatedKey = relatedKey;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getCreateUser() {
        return createUser;
    }

    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    public String getUpdateUser() {
        return updateUser;
    }

    public void setUpdateUser(String updateUser) {
        this.updateUser = updateUser;
    }

    public SysCode getServiceType() {
        return serviceType;
    }

    public void setServiceType(SysCode serviceType) {
        this.serviceType = serviceType;
    }
}
